/**
 * Copyright &copy; 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package cn.knet.sp.ncrm.modules.customer.potentialcall.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.knet.sp.ncrm.common.persistence.Page;
import cn.knet.sp.ncrm.common.service.CrudService;
import cn.knet.sp.ncrm.common.utils.StringUtils;
import cn.knet.sp.ncrm.modules.customer.potentialcall.entity.PotentialCall;
import cn.knet.sp.ncrm.modules.customer.potentialcall.dao.PotentialCallDao;

/**
 * 潜在客户呼叫记录Service
 * @author zhangbin
 * @version 2015-09-01
 */
@Service
@Transactional(readOnly = true)
public class PotentialCallService extends CrudService<PotentialCallDao, PotentialCall> {

	public PotentialCall get(String id) {
		return super.get(id);
	}
	
	public List<PotentialCall> findList(PotentialCall potentialCall) {
		if (StringUtils.isBlank(potentialCall.getPage().getOrderBy())) {
			potentialCall.getPage().setOrderBy("a.last_updated desc");
		}
		return super.findList(potentialCall);
	}
	
	public Page<PotentialCall> findPage(Page<PotentialCall> page, PotentialCall potentialCall) {
		return super.findPage(page, potentialCall);
	}
	
	@Transactional(readOnly = false)
	public void save(PotentialCall potentialCall) {
		super.save(potentialCall);
	}
	
	@Transactional(readOnly = false)
	public void delete(PotentialCall potentialCall) {
		super.delete(potentialCall);
	}
	
}